﻿@model Portal.Presentation.Models.UserInfoDataModel

@{
    ViewBag.Title = "Edit";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Edit user info</h2>

@{ if (!string.IsNullOrWhiteSpace(ViewBag.Error))
 {
    <div class="alert alert-danger">
        <strong>Error!</strong> @ViewBag.Error
    </div>
 }}


@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()

    <div class="form-horizontal">
        <hr />
        @Html.ValidationSummary(true)
        <div class="form-group">
            @Html.LabelFor(model => model.FirstName, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.FirstName)
                @Html.ValidationMessageFor(model => model.FirstName)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.LastName, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.LastName)
                @Html.ValidationMessageFor(model => model.LastName)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.PrimaryEmail, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.PrimaryEmail)
                @Html.ValidationMessageFor(model => model.PrimaryEmail)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.SecondaryEmail, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.SecondaryEmail)
                @Html.ValidationMessageFor(model => model.SecondaryEmail)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.PrimaryPhone, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.PrimaryPhone)
                @Html.ValidationMessageFor(model => model.PrimaryPhone)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.SecondaryPhone, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.SecondaryPhone)
                @Html.ValidationMessageFor(model => model.SecondaryPhone)
            </div>
        </div>

        <div class="form-group">
            <div class="col-md-offset-2 col-md-10">
                <button type="submit" class="btn btn-default" onclick="location.href='@Url.Action("Index", "UserInfo")'">Save</button>
            </div>
        </div>
    </div>
}
